package com.xiaoke.controller;

import com.xiaoke.domain.ResponseResult;
import com.xiaoke.service.CommentService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

/**
 * 评论表(Comment)表控制层
 *
 * @author xiaoke
 * @since 2023-03-17 09:40:33
 */
@RestController
@RequestMapping("/comment")
public class CommentController {
    /**
     * 服务对象
     */
    @Resource
    private CommentService commentService;

    /**
     * 获取最新评论
     */
    @GetMapping("/newCommentList")
    public ResponseResult newCommentList() {
        return commentService.newCommentList();
    }

    /**
     * 根据文章Id获取评论列表
     */
    @GetMapping("/getByArticleIdComment/{id}")
    public ResponseResult getByArticleIdComment(@PathVariable Long id) {
        return commentService.getByArticleIdComment(id);
    }




}

